import win32con
import win32clipboard as w


class GetText(object):
	'''保存到剪切板'''
	
	@staticmethod
	def getText():
		'''获得内容'''
		w.OpenClipboard()
		d = w.GetClipboardData(win32con.CF_UNICODETEXT)
		w.CloseClipboard()
		return d
		
	@classmethod
	def setText(cls,s):
		'''将 astring放在剪切板里面'''
		w.OpenClipboard()
		w.EmptyClipboard()
		w.SetClipboardData(win32con.CF_UNICODETEXT,s)
		w.CloseClipboard()
		
		
if __name__ == '__main__':
	text = GetText()
	
	text.setText('66666')
	text.getText()
		
		